<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input type="button" value="数据源" @click="getJoke">
        <p>{{commentTxt}}</p>
</div>
    <script>
        new Vue({
        el: '#app',
            data () {
        commentTxt:"我服了"
  },
  mounted:{
    getJoke:function(){
     var tha=this;
    axios
      .get('comment.json')
      .then(function(response){
          console.log(response.data);
          tha.commentTxt=response.data;
      },function(err){})
  }
}
})
    </script>
</body>
</html>